package junit;

import org.junit.*;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 11.05.11
 * Time: 13:52
 * To change this template use File | Settings | File Templates.
 */
public class SSComponentTr {

	private static ITestable component_for_test;

	@BeforeClass
	public static void init() {
		component_for_test = new Component();
		component_for_test.init();
	}

	@Before
	public void clear() {
		component_for_test.flush();
	}

//    @Ignore
	@Test
	public void saveTest() {
		Container cnr = new Container();
		cnr.int_val = 5;
		cnr.long_val = 6;
		cnr.string_val = "vallue";

		component_for_test.save(cnr);

		Container content = component_for_test.build();

		Assert.assertNotSame(content.int_val, cnr.int_val);
//		Assert.assertEquals(content.long_val, cnr.long_val);
//		Assert.assertEquals(content.string_val, cnr.string_val);
	}

	@Test
	public void getValTest() {
		int vale = component_for_test.getValue();
		Assert.assertEquals(vale, 1);
	}

	@AfterClass
	public static void onExit() {
		component_for_test.close();
	}
}
